#!/bin/bash
# Author: Joy Zhou
# Func:   Run all qitan user recommendation job

set -e -x
curdir=`dirname $0`
source $curdir/logutil.sh
log_path=${curdir}/../logs

date

declare -a job_array=(run_preprocess_user_relation_data.sh run_get_filter_list.sh run_get_follow_list.sh run_get_friend_list.sh run_get_follow_recommendation.sh run_get_friend_recommendation.sh run_get_resource_recommendation.sh run_get_feed_recommendation.sh run_get_pop_user_recommendation.sh run_aggregate_user_recommendation.sh)

for job in ${job_array[@]}
do
    date
    job_name=$(level_name $job)
    log_file=${log_path}/${job_name}.log
    cmd="$curdir/$job 1>>$log_file 2>&1 &"
    eval $cmd
    date
done
